

<template>
    <div id="app">
        <my-header :seller="seller"></my-header>
        <tab></tab>
        <keep-alive>    
            <router-view :seller="seller"></router-view>
        </keep-alive>
    </div>
</template>



<script>

import Header from 'components/header/header.vue';
import Tab from 'components/tab/tab.vue';
import {urlParam} from 'common/js/utill.js';

const ERR_OK = 0;

export default {
    data(){
        return {
            seller: {
                id: (() => {
                    let queryParam = urlParam();
                    return queryParam.id;
                })()
            }
        }
    },
    created(){
        this.$http.get('/api/seller?id=' + this.seller.id).then((res) => {
            const data = res.data;
            if(data.errno === ERR_OK){
                // this.seller = data.data;
                this.seller = Object.assign({},this.seller,data.data);
            }
        }, (err) => {
            alert(err);
        });
    },
    components: {
        'my-header': Header,
        'tab': Tab
    }

}

</script>




<style scoped lang="stylus" rel="stylesheet/stylus">


</style>




